package mysql

import "gorm.io/gorm"

type Doctor struct {
	gorm.Model
	TeamId         int    `gorm:"type:int(10);not null;comment:'团队Id'"`
	DoctorName     string `gorm:"type:varchar(10);not null;comment:'医生名称'"`
	DoctorSGinNum  int    `gorm:"type:int(10);not null;comment:'医生签约数量'"`
	DoctorPosition string `gorm:"type:varchar(10);not null;comment:'医生职位'"`
}

func DoctorList() (result []*Doctor, err2 error) {
	err2 = DB.Debug().Order("doctor_s_gin_num desc").Find(&result).Error
	if err2 != nil {
		return nil, err2
	}
	return
}

func DockerShow(id int) (result *Doctor, err2 error) {
	err2 = DB.Debug().Where("id = ?", id).Limit(1).Find(&result).Error
	if err2 != nil {
		return nil, err2
	}
	return
}
